package com.suxin.logger.handler;

import com.suxin.logger.LogRecord;

/**
 * @author Tang
 * @classname ConsoleHandler
 * @description [  ]
 * @date 2022/4/27 13:32
 */
public class ConsoleHandler extends StreamHandler {

    public ConsoleHandler() {
        setOutput(System.err);
    }

    @Override
    public void publish(LogRecord lr) {
        super.publish(lr);
        flush();
    }

    @Override
    public void close() {
        flush();
    }
}